package com.woniu.cq.medical.controller;


import com.woniu.cq.medical.common.Result;
import com.woniu.cq.medical.controller.form.ActForm;
import com.woniu.cq.medical.service.IActOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Lucas
 * @since 2020-09-10
 */
@RestController
@RequestMapping("/medical/act-order")
@CrossOrigin("*")//解决跨域问题
public class ActOrderController {

    @Autowired
    private IActOrderService actOrderService;

    @RequestMapping("selectAct")
    public Result selectAct(String patientIdCase){
        ActForm actForm = actOrderService.selectPatient(patientIdCase);
        return Result.success(actForm);
    }
    @RequestMapping("seleAct")
    public Result seleAct(String patientIdCase,String caseId){
        ActForm actForm = actOrderService.seleAct(patientIdCase, caseId);
        return Result.success(actForm);
    }

    @RequestMapping("submit")
    public Result submit(@RequestBody ActForm actForm){
        actOrderService.submit(actForm);
        return Result.success();
    }
}

